% example data
x = [ 1,2; 2,1; 3,3; 4,1; 2,10; 3,9; 4,8; 5,8; 6,9; 7,5; 6,2];
d = [ 1; 1; 1; 1; -1; -1; -1; -1; -1; -1; -1];

% execute the learning algorithm
[w, nw, ni, nmis] = PerceptronLearner(x, d)

% plot
plot(nmis)

% show data points and decision boundary
x1 = min(x(:,1)); xu = max(x(:,1));
y1 = min(x(:,2)); yu = max(x(:,2));
clf()
plot( x(1:4, 1), x(1:4, 2), 'r+', x(5:11, 1), x(5:11, 2), 'g+', [x1, xu], [-(x1*w(1)+w(3))/w(2), -(xu*w(1)+w(3))/w(2)])
axis(x1-abs(0.1*(xu-x1)), xu+abs(0.1*(xu-x1)), y1-abs(0.1*(yu-y1)), yu+abs(0.1*(yu-y1)))